<?php 
header('content-type:text/html; charset=utf-8');
@$ming=$_REQUEST['ming'];
session_start();

$pdo=new PDO('mysql:dbname=can;charset=utf8','root');
$s=$pdo->prepare('select * from zhuo');
$s->execute(array('ming'=>$ming));
$user=$s->fetchAll(PDO::FETCH_NAMED);
?>
<!DOCTYPE html>
<html>
   <head>
      <title>点餐系统</title>
	  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" charset="UTF-8" >
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <link href="css/bootstrap.min.css" rel="stylesheet">
      <script src="js/jquery-1.11.1.min.js"></script>
      <script src="js/bootstrap.min.js"></script>
      <!--[if lt IE 9]>
         <script src="js/html5shiv.js"></script>
         <script src="js/respond.min.js"></script>
      <![endif]-->
   </head>
  <style>
  	.c{color:blue;}
  </style>
   <body>
     <nav class="navbar navbar-default">
    <div class="container">
    <div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed"
					data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
					<span class="sr-only">切换</span> <span class="icon-bar"></span> <span
						class="icon-bar"></span> <span class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="/th4.php">点餐系统		<?php 
									if(isset($_SESSION['yazi'])){
										print_r("<a href='logout.php'></a>");
											}else{
											header('Refresh:2;url=/deng1.php');
												die('<h3>你还未登录，请先登录</h3>');
													}
													?></a>
			</div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">订单管理 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="dinglie.php">订单列表</a></li>
            <li><a href="dingji.php">订单记录</a></li>
          </ul>
        </li>
      </ul>
      <ul class="nav navbar-nav">
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">菜品管理 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="jcp.php">添加菜品</a></li>
            <li><a href="cpl.php">菜品列表</a></li>
            <li class="divider"></li>
            <li><a href="jcx.php">添加菜品类型</a></li> 
            <li><a href="cplie.php">菜品类型列表</a></li>
          </ul>
        </li>
      </ul>
	  <ul class="nav navbar-nav">
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">餐桌管理 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="jiazhuo.php">添加餐桌</a></li>
            <li><a href="canzl.php">餐桌列表 </a></li>
          </ul>
        </li>
      </ul>
	  <ul class="nav navbar-nav">
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">登录管理 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#" data-toggle="modal" data-target="#aboutModal">关于点餐系统</a></li>
            <li><a href="xiugai.php">修改登录信息</a></li>
            <li><a href="#tui" data-toggle="modal">退出登录</a></li>
          </ul>
        </li>
      </ul>
    </div>
  </div>
  <div class="modal fade" id="aboutModal" tabindex="-1" >
        	<div class="modal-dialog">
        		<div class="modal-content">
        			<div class="modal-header">
        				<button type="button" class="close" data-dismiss="modal">
        					<span>&times;</span><span class="sr-only">Close</span>
        				</button>
        				<h4 class="modal-title">关于皇子大酒店点餐系统</h4>
        			</div>
        			<div class="modal-body">
        			 本皇子大酒店，精选优质渣料，<br>
        			 选用上等地沟油，所有汤均用高级洗脚水熬制一天一夜而成。<br>
        			 各位顾客可放心点餐，我们还有优质的售后服务。<br>
        			 我们保证在顾客吃后负责挖坑，免除顾客的后顾之忧。<br>
        			 最后，感谢各位顾客的光临，我们的酒店因你而生辉。
        			 
        			</div>
        			<div class="modal-footer">
        				<button type="button" class="btn btn-warning" data-dismiss="modal">确定</button>
        			</div>
        		</div>
        	</div>
        </div>
        <div class="modal fade" id="tui" tabindex="-1" >
        	<div class="modal-dialog">
        		<div class="modal-content">
        			<div class="modal-header">
        				<button type="button" class="close" data-dismiss="modal">
        					<span>&times;</span><span class="sr-only">Close</span>
        				</button>
        				<h4 class="modal-title">确定退出登录</h4>
        			</div>
        			<div class="modal-body">
        			     你确定要退出登录吗？
        			</div>
        			<div class="modal-footer">
        				<a type="button" class="btn btn-default" href="tui.php">确定</a>
        				<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        			</div>
        		</div>
        	</div>
        </div>
</nav>
<div class="container">
	<div class="row">
	<div class="col-sm-3 col-md-2 page-left">
	   <a class="btn btn-default btn-block" href="jiazhuo.php">添加餐桌</a>
	   <a class="btn btn-default btn-block" href="th4.php">返回首页</a>
	</div>
	<hr class="visible-xs-block" >
	<div class="col-sm-9 col-md-10">
                <div class="panel panel-primary">
            <div class="panel-heading">
                <h1 class="panel-title">
                    <span class="glyphicon glyphicon-th-list"></span>
                                                            餐桌列表
                </h1>
            </div>
            <table class="table table-striped table-bordered table-hover">
            <tr>
                    <th>名称</th>
                    <th>&nbsp;</th>
                    <?php for($i=0;$i<count($user);$i++){ ?>
                </tr>
                <tr>
                <td><?php echo $user[$i]['ming']?></td>
                <td><a href='bian1.php?id=<?php echo $user[$i]['id'];?>'>编辑</a>　　<?php print_r("<a href='san1.php?id={$user[$i]['id']}'>删除</a>")?></td>
                </tr>
                <?php } ?>
            </table>
            </div>
            </div>
         </div>
       </div>
     </body>
  </html>